Test Series - Data Structure

Test Number 87/115

Q: Which node contains a pointer to its parent?
A. root node
B. right most child
C. left most child
D. left sibling
Solution: A node that is a leftmost node contains a pointer to its parent, otherwise, the node is a right sibling.
Q: What is the basic operation performed in a pairing heap?
A. merge
B. deletion
C. insertion
D. swapping
Solution: The basic operation performed in a pairing heap is merging. Insertion is also done by merging.
Q: If there are c children of the root, how many calls to the merge procedure is required to reassemble the heap?
A. c
B. c+1
C. c-1
D. 1
Solution: If there are c children of the root, then c-1 merges are required to reassemble the pairing heap.
Q: Which of the following methods is the best choice for complex applications?
A. binary heap
B. d-heap
C. treap
D. pairing heap
Solution: Pairing heap is the best choice for complex applications because it is simple and better than the others.
Q: Pairing heaps time complexity was inspired by that of?
A. splay tree
B. treap
C. red-black tree
D. avl tree
Solution: The pairing heaps insertion, deletion and search time complexity was initially inspired by that of splay trees.
Q: The roots of the elements of the subtrees are smaller than the root of the heap.
A. True
B. False
C. 
D. 
Solution: The heap ordering property requires that all the root elements of the subtrees in the list are not smaller than the root element of the heap.
Q: The amortized time efficiency for performing deletion of a minimum element is?
A. O(N)
B. O(log N)
C. O(N2)
D. O(M log N)
Solution: The amortized time efficiency for performing deletion of a minimum element is mathematically found to be O(log N).
Q: Out of the following given options, which is the fastest algorithm?
A. fibonacci heap
B. pairing heap
C. d-ary heap
D. binary heap
Solution: Although pairing heap is an efficient algorithm, it is worse than the Fibonacci heap. Also, pairing heap is faster than d-ary heap and binary heap.
Q: What is the run time efficiency of an insertion algorithm?
A. O(N)
B. O(log N)
C. O(N2)
D. O(M log N)
Solution: The run time efficiency of an insertion algorithm in a pairing heap is mathematically found to be O(N).

You Have Score    /9